package cn.com.roy.thread.t3_1_13.pipereaderwriter;

import java.io.IOException;
import java.io.PipedWriter;

public class WriteData {

    public void writeData(PipedWriter pipedWriter){
        System.out.println("Write :");
        try {
            for (int i = 0; i < 300; i++) {
                String outData = "" + (i+1);
                pipedWriter.write(outData);
                System.out.println(outData);
            }
            System.out.println();
            pipedWriter.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
